package com.cy.controller;

import com.cy.pojo.Emp;
import com.cy.service.EmpService;
import com.cy.util.JsonRuslt;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class EmpController {
    @Autowired
    EmpService empService;

    @GetMapping("/select")
    public JsonRuslt sele(Emp emp){
        return new JsonRuslt(empService.sel(emp));
    }


    @PostMapping("/insert")
    public JsonRuslt in(Emp emp){
        return new JsonRuslt(empService.ins(emp));
    }


    @PutMapping("/update")
    public JsonRuslt up(Emp emp){
        return new JsonRuslt(empService.upd(emp));
    }


    @DeleteMapping("/delete")
    public JsonRuslt de(Long[] ids){
        return new JsonRuslt(empService.dele(ids));
    }
}
